const mongoose = require('mongoose')

let userSchema = new mongoose.Schema({
  mail: {
    type: String,
    required: true,
    unique: true
  },
  uname: {
    type: String,
    required: true
  },
  upassword: {
    type: String,
    required: true
  },
  profile: {
    type: String
  },
  create_time: {
    type: String,
    require: true,
    default: Date.now()
  },
  tel: {
    type: Number,
    required: true
  },
  local: {
    type: String,
  },
  gender: {
    type: String,
    require: true
  },
  birthday: {
    type: String,
  },
  state: {
    type: Boolean,
    require: true,
    default: true
  }
})

module.exports = mongoose.model('user', userSchema, 'user')